{% macro horinput(name, label, prefill='') %}
<div class="control-group">
    <label class="control-label" for="input{{name}}">{{label}}</label>
    <div class="controls">
        <input type="text"
               name="{{name}}"
               id="input{{name}}"
               placeholder="{{label}}"
               value="{{prefill}}">
    </div>
</div>
{% endmacro %}

{% macro hortextarea(name, label, rows, prefill='') %}
<div class="control-group">
    <label class="control-label" for="input{{name}}">{{label}}</label>
    <div class="controls">
        <textarea id="input{{name}}"
                  name="{{name}}"
                  placeholder="{{label}}"
                  rows="{{ rows|default(3) }}">{{prefill}}</textarea>
    </div>
</div>
{% endmacro %}


{% macro submit(label) %}
<button type="submit" class="btn">{{label|default('Sauvegarder')}}</button>
{% endmacro %}

{% macro horsubmit(label) %}
{% import _self as forms %}
<div class="control-group">
    <div class="controls">{{ forms.submit(label) }}</div>
</div>
{% endmacro %}

{% macro personne(p) %}
{% import _self as forms %}
{{ forms.horinput('Prenom', 'Prenom', p['Prenom']) }}
{{ forms.horinput('Nom', 'Nom', p['Nom']) }}
{{ forms.hortextarea('Adresse', 'Adresse', 3, p['Adresse']) }}
{{ forms.horinput('Date_Naissance', 'Date Naissance', p['Date_Naissance']) }}
{% endmacro %}
